import { Redirect } from "umi";
export default (props)=>{
    const token=sessionStorage.getItem("token")
    if(props.location.pathname === '/login'){
        console.log(11111);
        if(token){
            return <Redirect to="/home"></Redirect>
        }else{
            if(!token){
                return <Redirect to="/login"></Redirect>
            }
        }
    }
    return (<>{props.children}</>)
}